﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Web.UI.WebControls;
using DAL;
using Utils;

namespace BLL
{
  public static class XmlDicBiz
    {
      //UI 获取 设定的字段， 一般用的场合少
      public static string GetFieldsList(string key)
      {
         return  XmlUtility.ReadFiled(key);
      }

        //YearList.xml
      public static void InitYear(DropDownList dropDownList,  string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "YearList.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }
      public static void InitMonth(DropDownList dropDownList,  string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "MonthList.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }
      public static void InitDay(DropDownList dropDownList,  string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "DayList.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }
      
      //部门属性 UI.ModEmployee.DepartmentStructureManage.DDListDepartmentPropertie
      public static void InitDeptPrep(DropDownList dropDownList,  string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "DepatmentPrepreties.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }
      public static void InitGroupType(DropDownList dropDownList,  string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "GroupType.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }

       #region 人事工资相关
      //工号规则  UI.ModEmployee.EmpCreateCode.DDLCodeRule
      public static void InitEmpCodeRule(DropDownList dropDownList,  string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "EmpCodeRule.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }
      //转正类别 UI.ModEmployee.EmpPassedAdd。ddlPassedTypeName
      public static void InitPassedInfoType(DropDownList dropDownList,  string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "PassedInfoType.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }
      //工资状态  UI.ModEmployee.EmpAdd.ddlSalaryState
      public static void InitSalaryState(DropDownList dropDownList,  string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "SalaryState.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }
      //工资接口 UI.ModSalary.DefAccountSetItem  帐套的项目定义
      public static void InitWageInterface(DropDownList dropDownList,  string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "WageInterface.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }
      //离职类别 UI.ModEmployee.EmpLeaveAdd.ddlLeaveType
      public static void InitLeaveType(DropDownList dropDownList,  string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "LeaveType.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }
     
      #endregion


      //省份  UI.CrmCustomer.CustomerAdd.ddlProvince
      public static void InitProvince(DropDownList dropDownList,  string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "ProvinceList.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }
      //客户等级  UI.CrmCustomer.CustomerAdd.ddlGade
      public static void InitCustGade(DropDownList dropDownList, string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "CustGade.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }
      //组织形式  UI.CrmCustomer.CustomerAdd.ddlOrganize
      public static void InitCustOrganize(DropDownList dropDownList, string defaultItem)
      {
          XmlUtility.InitXMLDropDownList(dropDownList, "CustOrganize.xml", defaultItem);
          dropDownList.SelectedValue = defaultItem;
      }

      
    }
}
